-
Notifications
You must be signed in to change notification settings - Fork 63
Use gitignore in streaming mode as well #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements proper .gitignore handling in streaming mode by replacing WalkDir with WalkBuilder from the ignore crate.
- Added
WalkBuilderconfiguration insrc/lib.rsto respect.gitignorerules consistently across both streaming and file output modes - Added comprehensive end-to-end tests in
tests/test_gitignore_e2e.rsto verify ignore patterns work in both modes - Removed explicit gitignore check since
WalkBuildernow handles it internally - Set
follow_linksto false to match Git's behavior for symlinks
2 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
|
@greptileai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
This PR extends the gitignore functionality improvements with additional test coverage and error handling refinements.
- Added environment variables
NO_COLORandCIintests/test_gitignore_e2e.rsto ensure consistent non-interactive test behavior - Improved error messages in file reading operations with detailed path information
- Simplified binary file detection by removing user-defined extensions in streaming mode
- Disabled git_global and git_exclude in
WalkBuilderto only use local .gitignore files
3 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile
tests/test_gitignore_e2e.rs
Outdated
| let repo = setup_temp_repo(); | ||
|
|
||
| // Create files without .gitignore | ||
| create_file(repo.path(), "binary.jpg", "ÿØÿÛ"); // JPEG magic bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: JPEG magic bytes are not properly encoded in the test file. Consider using actual binary data or hex encoding
Fixes #25